<?php
 $username=$_POST['user'];
 $password=$_POST['password']; 

 $arr1=['zhangsan','lisi'];
 if(in_array($username,$arr1)){
     echo "用户名已存在";
 }else{
   echo "用户名可用";
 }
?>